﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Annotations;

namespace SharedGenomics.Workbench.Annotations
{
    public class AnnotationRepositoryMediator : IAnnotationRepositoryMediator
    {
        private readonly AnnotationRepository _repository;

        public AnnotationRepositoryMediator(AnnotationKeyDependencyGraphProvider dependencyGraphProvider)
        {
            var dependencyGraph = dependencyGraphProvider.GetAnnotationDependencyGraph();
            this._repository = new AnnotationRepository(dependencyGraph);
        }

        public object GetAnnotationForTarget(AnnotationKey annotationKey, object rootValue)
        {
            return this._repository.GetAnnotationForTarget(annotationKey, rootValue);
        }

        public void Add(AnnotationKey key, object value, AnnotationValue parentValue)
        {
            this._repository.Add(key, value, parentValue);
        }
    }
}
